﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System;
using Beyond;
using ZJ_WangSir;

namespace ZJ_WangSir
{
    public class CUtils
    {
        public static void SetRemoveAds(bool value)
        {
            CPlayerPrefs.SetBool("remove_ads", value);
        }

        public static bool IsAdsRemoved()
        {
            return CPlayerPrefs.GetBool("remove_ads");
        }


        public static void SetUnlockAll(bool value)
        {
            CPlayerPrefs.SetBool("UnlockAll", value);
        }


        public static bool IsUnlockAll()
        {
            return CPlayerPrefs.GetBool("UnlockAll");
        }


        public static void Set5StarsEvaluate(bool value)
        {
            CPlayerPrefs.SetBool("5StarsEvaluate", value);
        }

        public static bool IsSet5StarsEvaluate()
        {
            return CPlayerPrefs.GetBool("5StarsEvaluate");
        }

        public static void ShowInterstitialAd()
        {
            if (IsAdsRemoved()) return;
            Debug.Log("AdmobController.interstitial*-*-*-*-*-*-*-*-*-*-*-*-*");
            Ads.showAd(Ads.Type.interstitial);
        }

        public static void ShowBannerAd()
        {
            if (IsAdsRemoved()) return;
            Debug.Log("AdmobController.ShowBanner*-*-*-*-*-*-*-*-*-*-*-*-*");
            Ads.showAd(Ads.Type.banner);
        }

        public static void CloseBannerAd()
        {
            Debug.Log("AdmobController.HideBanner*-*-*-*-*-*-*-*-*-*-*-*-");
            Ads.hideAd(Ads.Type.banner);
        }

        public static void RecordCompletedValue(int value)
        {
            CPlayerPrefs.SetInt("CompletedValue", value);
        }

        public static int GetCompletedValue()
        {
            return CPlayerPrefs.GetInt("CompletedValue");
        }
    }
}
